package com.boot.security.server.controller;

import com.boot.security.server.dict.service.IDictService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * 下拉
 * @author king
 */
@RestController
@RequestMapping("/dropDown")
public class DropDownController {
    @Autowired
    private IDictService dictService;

    @PostMapping("/getBranch")
    @ApiOperation(value = "公司")
    public List<Map<String, Object>> getBranch () {
        return dictService.findBranchByCode();
    }

    @PostMapping("/getUser")
    @ApiOperation(value = "用户")
    public List<Map<String, Object>> getUser () {
        return dictService.findUser();
    }

    @PostMapping("/getUserName")
    @ApiOperation(value = "用户")
    public List<Map<String, Object>> getUserName () {
        return dictService.getUserName();
    }

    @PostMapping("/getBranchByUserId")
    @ApiOperation(value = "根据用户查询公司")
    public List<Map<String, Object>> getBranchByUserId () {
        return dictService.findBranchByCodeAndUserId();
    }

    @PostMapping("/getOverseeForm")
    @ApiOperation(value = "督察形式")
    public List<Map<String, Object>> getOverseeForm () {
        return dictService.findOverseeFormByCode();
    }

    @PostMapping("/getQuestion")
    @ApiOperation(value = "问题类别")
    public List<Map<String, Object>> getQuestion () {
        return dictService.findQuestionByCode();
    }

    @PostMapping("/getQuestionKeyword")
    @ApiOperation(value = "关键字")
    public List<Map<String, Object>> getQuestionKeyword () {
        return dictService.findQuestionKeywordByCode();
    }

    @PostMapping("/getYear")
    @ApiOperation(value = "年份")
    public List<Map<String, Object>> getYear () {
        return dictService.findYearByCode();
    }

    @PostMapping("/getSchedule")
    @ApiOperation(value = "进度")
    public List<Map<String, Object>> getSchedule () {
        return dictService.findScheduleByCode();
    }

    @PostMapping("/getOversee")
    @ApiOperation(value = "督察人员")
    public List<Map<String, Object>> getOversee () {
        return dictService.getOversee();
    }

    @PostMapping("/getSourceProblem")
    @ApiOperation(value = "问题来源")
    public List<Map<String, Object>> getSourceProblem () {
        return dictService.findSourceProblemByCode();
    }

    @PostMapping("/getReviewer")
    @ApiOperation(value = "审核人")
    public List<Map<String, Object>> getReviewer () {
        return dictService.findReviewerByCode();
    }

    @PostMapping("/getSex")
    @ApiOperation(value = "性别")
    public List<Map<String, Object>> getSex () {
        return dictService.findSexByCode();
    }

    @PostMapping("/getStatus")
    @ApiOperation(value = "状态")
    public List<Map<String, Object>> getStatus () {
        return dictService.findStatusByCode();
    }
}
